//
// Header
//

._header {
  position: fixed;
  z-index: var(--headerZ);
  top: 0;
  left: 0;
  right: 0;
  height: var(--headerHeight);
  line-height: var(--headerHeight);
  background-color: #fff;
  background-image: asset_url('header-background.png');
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.07);
  @extend %user-select-none;

  body.docs & {
    margin-left: var(--sidebarWidth);
    @include mobile { margin-left: var(--sidebarMediumWidth); }
  }
  // @include mobile { width: var(--sidebarMediumWidth); }
}


//
// Navigation menu
//

._nav {
  float: right;
  margin-right: .5rem;
  font-size: .875rem;
  color: var(--textColor);
}

._nav-link,
._nav-link:hover {
  position: relative;
  float: left;
  padding: 0 1.25rem;
  color: inherit;
  text-decoration: none;

  @media #{$mediumScreen} { padding: 0 .75rem; }
}

._nav-link {
  &:before, &:after {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 0;
    margin-left: -.375rem;
    border: .575rem solid transparent;

  }

  &:after {
    bottom: -0.275rem;
    border: 0.775rem solid transparent;
    border-bottom-color: var(--contentBackground);
    margin-left: -9px;
  }
}

._nav-current {
  outline: 0;

  &:before, &:after { content: ''; }
}

//
// Logo
//

._logo,._logo-sub-nav {
  position: relative;
  float: left;
  height: var(--headerHeight);
  margin: 0;
  line-height: inherit;
  font-size: inherit;
  cursor: default;

  > ._nav-link {
    float: none;
    margin-left: .75rem;
    padding: 0 .25rem;
  }
}

//
// Search form
//

._search {
  -ms-flex: 1 1 auto;
      flex: 1 1 auto;
  position: fixed;
  z-index: var(--sidebarZ);
  top: 0;
  left: 0;
  right: 0;
  float: left;
  width: var(--sidebarWidth);
  height: var(--headerHeight);
  padding: .5rem 0 .5rem .5rem;
  @extend %border-box;

  line-height: var(--headerHeight);
  background-color: #fff;
  background-image: asset_url('header-background.png');
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.07);

  @media #{$mediumScreen} { width: var(--sidebarMediumWidth); }

  &:before {
    position: absolute;
    top: 1rem;
    left: 1rem;
    opacity: .4;
    z-index: 2;
    @extend %icon, %icon-search;
  }
}

._search-input {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 .75rem 1px 1.75rem;
  font-size: .875rem;
  background: var(--contentBackground);
  border: 1px solid;
  border-color: var(--searchBorder);
  border-radius: 3px;

  &:focus {
    outline: 0;
    border-color: var(--inputFocusBorder);
    box-shadow: 0 0 1px var(--inputFocusBorder);
  }

  &[disabled] {
    background: var(--sidebarBackground);
    cursor: not-allowed;
  }
}

._search-clear {
  display: none;
  position: absolute;
  top: .5em;
  right: 0;
  width: 1.75rem;
  height: 2rem;
  opacity: .42;
  @extend %hide-text;

  &:hover { opacity: .7; }
  &:before {
    position: absolute;
    top: .5rem;
    left: .5rem;
    @extend %icon, %icon-clear;
  }


  ._search-active > & { display: block; }
}

._search-tag {
  display: none;
  position: absolute;
  z-index: 2;
  top: .875rem;
  left: .875rem;
  padding: 0 .375rem;
  line-height: 1.25rem;
  max-width: 50%;
  font-size: .8125rem;
  color: var(--textColorLight);
  background: var(--searchTagBackground);
  border-radius: 2px;
  cursor: pointer;
  @extend %truncate-text;
}
